package com.dnjn.mes.biz.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dnjn.mes.biz.enums.AddrCode;
import com.dnjn.mes.biz.enums.AddrType;
import com.dnjn.mes.biz.enums.DataType;
import com.dnjn.mes.common.core.domain.BaseEntity;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * <p>
 * modbus地址对应表
 * </p>
 *
 * @author Amber
 * @since 2023-07-27
 */
@Getter
@Setter
@TableName("mes_register_address")
public class MesRegisterAddress extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * PK
     */
    @TableId(value = "address_id", type = IdType.ASSIGN_ID)
    private Long addressId;

    /**
     * 地址类型 val:状态-status 产能-capacity 节拍-beat 异常-except
     */
    private AddrType addrType;

    /**
     * 地址编号
     */
    private AddrCode addrCode;

    /**
     * 名称
     */
    private String addrName;

    /**
     * PLC地址
     */
    @NotBlank(message = "PLC地址不能为空")
    private String addrPlc;

    /**
     * modbus地址
     */
    private Integer addrModbus;

    /**
     * 返回数据类型 BOOL,DWORD
     */
    private DataType dataType;

    /**
     * 单位秒S
     */
    @NotNull(message = "间隔不能为空")
    private Integer duration;

    private Long equipmentId;


}
